package com.pengbei.enshrine.common.utils;

import android.app.Activity;

import com.hjq.permissions.XXPermissions;

public class CheckUtils {
    private  static long mLastClickTime = 0;
    public static final long TIME_INTERVAL = 500L;
    public static boolean isFastDoubleClick() {
        long nowTime = System.currentTimeMillis();
        if (nowTime - mLastClickTime > TIME_INTERVAL) {
            mLastClickTime = nowTime;
            return false;
        } else {
//            ToastUtils.showWarn("请不要重复点击");
            return true;
        }
    }

    public static boolean checkPermission(Activity context, String permission) {
        System.out.println("===============权限=============="+ XXPermissions.isGranted(context,permission));
        return !XXPermissions.isGranted(context,permission);
    }


}
